import java.util.Objects;

public class Person /*implements Comparable*/{
    public String id;

    public Person(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(id, person.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    public static void main(String[] args) {
        Person p = new Person("123");
        Person p2 = new Person("123");

        System.out.println(p.hashCode());
        System.out.println(p2.hashCode());
    }
}
